package com.hl.card.modular.packBack.controller;

import com.alibaba.fastjson.JSONObject;
import com.hl.card.common.controller.BaseController;
import com.hl.card.common.util.CommonUtil;
import com.hl.card.common.util.ResponseData;
import com.hl.card.modular.packBack.service.GoodsSevice;
import com.hl.card.modular.packBack.service.FreezingManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 比豆交易明细管理前端控制
 * 
 * @author zhouyongbang
 * @Date 2018-06-13 11:37:08
 */
@Controller
@RequestMapping("/freezinglManag")
/*@RequestMapping("/api/integralManag")*/
public class FreezingManageController extends BaseController {

	@Autowired
    private FreezingManageService freezingManageService;
	

	@Autowired
	private ResponseData responseData;
	
	@Resource
    private GoodsSevice goodsSevice;
	
	private String PREFIX = "/packback/freezingManage/";
	/**
     *   比豆交易记录主页
     */
    @RequestMapping("")
    public String index(){
        return PREFIX+"freezingManage.html";
    }
	/**
	 * 
	 * @param start end
	 * @return
	 */
	@RequestMapping("/queryfreezingManage")
	@ResponseBody
	public Object queryfreezingManage(Integer start,Integer end,String dealCreateTime,String dealEndTime,String productType, String merchantOrderNumber, String dealRecordNumber,String userPhone,String goodsCode) {
		responseData.setData(null);
		if (CommonUtil.isEmpty(start)) {
			responseData.setStatus("0");
			responseData.setMsg("不能为空");
			return responseData;
		}
		if(end==null||"".equals(end))
		{
			end=1;
		}
		/* List<Map<String, Object>> list= goodsSevice.selectList();
	        model.addAttribute("goods",list);*/
		JSONObject responseData= freezingManageService.queryfreezingManage(start,end,dealCreateTime,dealEndTime,productType,merchantOrderNumber,dealRecordNumber,userPhone,goodsCode);
	     
		/*System.out.println(responseData);*/
		return responseData.get("list");
	}
}
